package net.mihome.app.bean;

import java.util.Map;

/**
 * Created by zhao on 2015/2/7.
 * "uid": 1,
 "id": 1,
 "update_at": "2015-02-07 10:05:51",
 "create_at": "2015-02-06 18:20:37",
 "top_id": 847,
 "unread_count": 6
 */
public class DazibaoUnread {
    private Long unreadCount;
    private Long topId;

    public static DazibaoUnread parse(Map map){
        if(map!=null){
            DazibaoUnread dazibaoUnread=new DazibaoUnread();
            if(map.get("top_id")!=null){
                Double d= (Double) map.get("top_id");
                dazibaoUnread.setTopId(new Long(d.intValue()));
            }
            if(map.get("unread_count")!=null){
                Double d= (Double) map.get("unread_count");
                dazibaoUnread.setUnreadCount(new Long(d.intValue()));
            }
            return dazibaoUnread;
        }else{
            return null;
        }
    }

    public Long getUnreadCount() {
        return unreadCount;
    }

    public void setUnreadCount(Long unreadCount) {
        this.unreadCount = unreadCount;
    }

    public Long getTopId() {
        return topId;
    }

    public void setTopId(Long topId) {
        this.topId = topId;
    }
}
